package com.bw.database.dao

import androidx.room.*
import com.bw.database.entity.UserInfoEntity

/**
 * 用户信息Dao
 *
 *
 * ORM类型数据库 对象关系数据库（增删改查）（Room GreenDao）
 * SQLite数据库 操作SQL语句
 *
 *
 */
@Dao
interface UserInfoDao {

    //vararg代表可以批量操作,1或多
    @Insert
     suspend fun insertUserInfo(vararg userInfo: UserInfoEntity)

    @Delete
    suspend fun deleteUserInfo(vararg userInfo: UserInfoEntity)

    @Update
    suspend fun updateUserInfo(vararg userInfo: UserInfoEntity)

    @Query("select * from user_info_table order by id")
    suspend fun queryAllUserInfo():List<UserInfoEntity>


    @Query("select * from user_info_table where id = :userId")
    suspend fun queryUserById(userId:Int):UserInfoEntity


}